﻿@{
    ViewBag.Title = "Quản lý tỉnh / thành";
    Layout = "~/Views/Shared/_Layout.Management.cshtml";
}
<h2 class="app">
	<strong>Quản lý tỉnh / thành</strong>
</h2>
<div class="title">
    <span class="right-btns">
        <input id="searchKeyword" type="text" class="text spl search filter" style="margin-top: -1px;" data-bind="value: Keywords, event: { keypress: RunSomethingKey }" />
        <a href="#" class="btn btn-go" data-bind="click: SearchButton">Go</a>
        <span class="v-line"></span>
        <a href="/Management/StateList/Add" class="btn-addnew">Thêm mới &raquo;</a>
    </span>
    <h3>Xem tỉnh / thành phố</h3>
</div>
<span class="paging">
    <span class="pageleft">
        <span class="total" data-bind='text: PageText'></span>
        <span class="show">Hiển thị <input type="text" class="text" data-bind="value: PageSize" onkeypress="return isNumberKey(event)" /> trên trang</span>
    </span>
    <span class="pages">Trang <input type="text" class="text" data-bind="value: CurrentPageIndex" onkeypress="return isNumberKey(event)" /> của <span data-bind="text: maxPageIndex"></span>
    <a href="##" class="btn btn-prev-arrow" data-bind="click: PrevButton, attr: {'class': PrevButtonClass}"></a>                            
    <a href="##" class="btn btn-next-arrow" data-bind="click: NextButton, attr: {'class': NextButtonClass}"></a>
    </span>
</span>

<table class="tablegrid" cellspacing="0" border="0">
    <thead>
        <tr class="title"> 
		    <th>
                <span class="w">
                    <a href="#" data-bind='click: function(event) { SetOrder(event, "Name")}'>Tiêu đề</a>
                    <div class="sort_wrapper" id="Name">  
                        <span class="grid_order ui_icon"></span>
                    </div>               
                </span>
            </th>   
		    <th class="ordered">
                <span class="w">Mã</span>
            </th> 
		    <th class="ordered centeralign">
                <span class="w">Thứ tự</span>
            </th>
		    <th class="centeralign">
                <span class="w">Top</span>
            </th>
            <th class="datetime">
                <span class="w">Ngày tạo</span>
            </th>
            <th class="active centeralign">
                <span class="w">Kích hoạt</span>
            </th>
		    <th class="last centeralign"><span class="w">Xóa</span></th>
        </tr>
    </thead>
    <tbody data-bind="foreach: ItemsOnPage">
        <tr class="line" data-bind="attr: {'class': Active? 'line': 'line new'}">
		    <td>
                <span class="w" style="font-weight:bold"><a data-bind='text: Name, attr: {href: "/Management/StateList/Edit/" + ID}'>Edit</a></span>
            </td>
		    <td>
                <span class="w" data-bind='text: ID'>
                </span>
            </td>
		    <td>
                <span class="w" data-bind='text: Ordered'>
                </span>
            </td>
            <td class="active centeralign">
                <span class="w">
                    <input type="checkbox" name="active" disabled="disabled" data-bind="checked: IsTop" />
                </span>
            </td>
		    <td class="datetime centeralign">
                <span class="w" data-bind='text: DateCreated'>
                </span>
            </td>
            <td class="active centeralign">
                <span class="w">
                    <input type="checkbox" name="active" disabled="disabled" data-bind="checked: Active" />
                </span>
            </td>
		    <td class="last centeralign">
                <span class="w">
                    <a class="btn btn-x delete" href="##" data-bind='attr: {id: "state" + ID, rel: Name, onclick: DeleteDialog}'>Delete</a>
                </span>
            </td>
	    </tr>
    </tbody>
</table>

@Html.Partial("_PopupConfirmDeleted")
<script type="text/javascript">
    var data = @(Html.Raw(Json.Encode(Model)));
</script>
<script src="/Scripts/ViewModel/stategrid.js" type="text/javascript"></script>